<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>工单详情</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <meta name="viewport"
          content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <!--1.width=device-width    //应用程序的宽度和屏幕的宽度是一样的
2.height=device-height  //应用程序的高度和屏幕的高是一样的
3.initial-scale=1.0  //应用程序启动时候的缩放尺度（1.0表示不缩放）
4.minimum-scale=1.0  //用户可以缩放到的最小尺度（1.0表示不缩放）
5.maximum-scale=1.0  //用户可以放大到的最大尺度（1.0表示不缩放）
6.user-scalable=no  //用户是否可以通过他的手势来缩放整个应用程序，使应用程序的尺度发生一个改变（yes/no）
    -->
    <!-- 优先使用 IE 最新版本和 Chrome -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <!-- 启用360浏览器的极速模式(webkit) -->
    <meta name="renderer" content="webkit">
    <link href="{{asset('admin/css/bootstrap.min.css')}}" rel="stylesheet" type="text/css" />

    <link rel="stylesheet" href="{{asset('4s/font-awesome-4.7.0/css/font-awesome.css')}}">
    <link rel="stylesheet" href="{{asset('4s/style/weui.min.css')}}"/>
    <link rel="stylesheet" href="{{asset('4s/style/style.css')}}"/>
</head>
<body style="background: #f5f5f5">
<!--头部-->
<!-- <div class="search-box">
    <button class="btn fa fa-angle-left back-icon"></button>
    <span>咨询详情</span>
</div>  -->
<!--end 头部-->
<div class="banner"><img src="https://zixun.c-make.net/zhuanjia/images/topbanner.png" alt=""></div>
<!--主体-->
<div class="detail-box" style="padding: 10px;">

    <!--咨询-->
    <h4 class="item-title">工单内容</h4>
    <div class="detail-white-box">
        <h4 class="detail-box-title">单号：{{$data->code}}</h4>
        <h5 class="detail-box-title">时间：{{$data->created_at}}</h5>
        <h5 class="detail-box-title">车牌号：{{$data->car_num?$data->car_num:$data->car->car_num}}</h5>

        <div class="detail-box-text">
        <p>车型：{{object_get($data,'car.brand.name')}} {{object_get($data,'car.serie.name')}}</p>    
        <p>送修人：{{$data->name}} &nbsp;电话：<a href="tel:{{$data->phone}}">{{$data->phone}}</a></p>
            
           
            <p>送修日期：{{$data->arrived_at}}</p>
            <p>送修里程：{{$data->miles}}公里</p>
            <p>维修类型：{{object_get($data,'maintain.name')}}</p>
            <p>故障信息：{{$data->bug_info}}</p>

            <p>维修负责人：{{object_get($data,'worker.truename')}} &nbsp;电话：<a href="tel:{{object_get($data,'worker.phone')}}">{{object_get($data,'worker.phone')}}</a></p>
            <p>工单状态： {{$data->status_txt}}</p>
             <p>金额：{{$data->total_money}}</p>
             <p>备注：{{$data->remark}}</p>
        </div>

        
        
       
        <!--end 上传的图片-->
    </div>
    <!--咨询-->
    <div class="">
        <table class="table">
                <tr>
              
                <th>服务项目</th>
                <th>费用</th>
                
                
                </tr>
                       @foreach($data->service as $pro)
                       <tr>
                       
                      <td>
                        {{object_get($pro,'service.name')}} 
                        </td>
                        <td>
                          {{$pro->service_price}} 
                      </td>
                     
                      </tr>
                       @endforeach
                        </table>

            <table class="table">
                <tr>
                
                <th>配件名称</th>
                <th>配件数量</th>
                <th>费用</th>
                
                </tr>
                       @foreach($data->depart as $d)
                       <tr>
                        <td>

                    {{$d->depart->name}}</td>
                      <td>
                        {{$d->depart_num}} &nbsp;&nbsp; 
                        </td>
                        <td>
                          {{$d->total_price}}
                      </td>
                     
                      </tr>
                       @endforeach
                        </table>
    </div> 

   
 
    @if($data->status<100 && $worker)
    <!-- 继续回复-->
    <div class="ask-box">
        <form action="{{url('user/task/complete')}}?task_id={{$data->id}}" method="post">
        <div class="weui-cells__title title-ask">完工备注</div>
        <div class="weui-cells weui-cells_form">
            <div class="weui-cell">
                <div class="weui-cell__bd">
                    <textarea class="weui-textarea" placeholder="请输入详细信息..." rows="5" name="remark" required=""></textarea>
                </div>
            </div>
        </div>
        
        
        <!--end上传图片-->
        <div class="ask-btn-box">
            <button type="submit" class="weui-btn weui-btn_mini weui-btn_primary">完工</button>
        </div>

        

{{csrf_field()}}
        </form>
    </div>
    @endif

    <!-- end继续回复-->
</div>
<!--主体-->

<!--js-->
<script src="{{asset('4s/js/jquery-2.2.3.min.js')}}"></script>

@include('4s.footer')
</body>
</html>